/*
* Return task to run next...
*/
- ret.time = MILLISECS(CSCHED_MSECS_PER_TSLICE);
+ ret.time = (is_idle_vcpu(snext->vcpu) ?
+ -1 : MILLISECS(CSCHED_MSECS_PER_TSLICE));
ret.task = snext->vcpu;
CSCHED_VCPU_CHECK(ret.task);
s_time_t now = NOW();
struct schedule_data *sd;
struct task_slice next_slice;
- s32 r_time; /* time for new dom to run */
ASSERT(!in_irq());
ASSERT(this_cpu(mc_state).flags == 0);
/* get policy-specific decision on scheduling... */
next_slice = ops.do_schedule(now);
- r_time = next_slice.time;
next = next_slice.task;
sd->curr = next;
- if ( !is_idle_vcpu(next) )
- set_timer(&sd->s_timer, now + r_time);
+ if ( next_slice.time >= 0 ) /* -ve means no limit */
+ set_timer(&sd->s_timer, now + next_slice.time);
if ( unlikely(prev == next) )
{
next->domain->domain_id,
(next->runstate.state == RUNSTATE_runnable) ?
(now - next->runstate.state_entry_time) : 0,
- r_time);
+ next_slice.time);
ASSERT(prev->runstate.state == RUNSTATE_running);
vcpu_runstate_change(